using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpwanManager : MonoBehaviour
{
    public GameObject enemy;
    
    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("spawn", 1f,2f);
       
    }

    // Update is called once per frame
    void Update()
    {
        //if (transform.position.x<=-10f)
        //{
            //Destroy(gameObject, 1f);
        //}
    }
    public void spawn()
    {
        Instantiate(enemy);
    }
}
